﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace IFTRUE.EIMS.Web.Aspx
{
    public partial class UserInfo :PageBase
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string strAccount = Request["ids"];
                if (string.IsNullOrEmpty(strAccount))
                {
                    hidAccount.Value = string.Empty;
                    return;
                }
                Model.UserInfo userInfoModel = new BLL.UserInfo().Get(strAccount);
                if (userInfoModel == null)
                {
                    return;
                }
                hidAccount.Value = userInfoModel.Account;
                account.Value = userInfoModel.Account;
                email.Value = userInfoModel.Email;
                name.Value = userInfoModel.Name;
                phone.Value = userInfoModel.Phone;
                isuse.Checked = userInfoModel.IsUse;
                password.Value = "********";
                password.Attributes.Add("readonly", "true");
                account.Attributes.Add("readonly", "true");
                if (strAccount == "admin")
                {
                    isuse.Attributes.Add("disabled", "true");
                }
            }
        }
    }
}